// 处理input状态逻辑(mixins)
export default {
  data() {
    return {
      usernameCls: false,
      passwordCls: false
    };
  },
  computed: {
    cUsernameCls() {
      return {
        usernameActive: this.usernameCls
      };
    },
    cPasswordCls() {
      return {
        passwordActive: this.passwordCls
      };
    }
  },
  methods: {
    changeActive(props, status) {
      let map = {
        username: "usernameCls",
        password: "passwordCls"
      };
      this[map[props]] = status;
    },
    focusCls(props) {
      this.changeActive(props, true);
    },
    blurCls(props) {
      this.changeActive(props, false);
    }
  }
};
